<?php 
	  $stats = Doctrine::getTable('BbPlayerStat')->getBoxStats($match->getId()); 
	  $team1 = Doctrine::getTable('BbTeams')->findOneById($match->getTeam1Id()); 
	  $team2 = Doctrine::getTable('BbTeams')->findOneById($match->getTeam2Id()); 
	
	  $players1 = $team1->getPlayers();
      $players2 = $team2->getPlayers();
      
      ?>
<div class="mod-content">
		<table cellspacing="1" cellpadding="3" class="tablehead">
			<tbody>
			<tr align="right" class="colhead">
				<td align="left">#</td>
				<td align="left">ТОГЛОГЧ</td>
				<td align="left">FGM-FGA</td>
				<td align="left">3PTA-3PTM</td>			
				<td align="left">FTM-FTA</td>				
				<td align="left">OFF</td>
				<td align="left">REB</td>
				<td align="left">AST</td>
				<td align="left">TOV</td>
				<td align="left">STL</td>
				<td align="left">BLK</td>
				<td align="left">PF</td>
				<td align="left">PTS</td>
            </tr>
       		<?php $odd=1;?>	
          	<?php $tfgm=0; $tfga=0; $tpt3m=0; $tpt3a=0; $tftm=0; $tfta=0; $toff=0; $treb=0; $tast=0; $ttov=0; $tstl=0; $tblk=0; $tpf=0; $tpts=0; ?>      
            <?php foreach ($players1 as $player): ?>
              <?php $playerId = $player->getId(); ?>
              <?php $stat = $stats[$playerId]; ?>
              <?php 
              		$tfgm += $stat->getFgm(); 
              		$tfga += $stat->getFga(); 
              		$tpt3m += $stat->getPt3m(); 
              		$tpt3a += $stat->getPt3a(); 
              		$tftm += $stat->getFtm(); 
              		$tfta += $stat->getFta(); 
              		$toff += $stat->getOffreb(); 
              		$treb += $stat->getReb(); 
              		$tast += $stat->getAst(); 
              		$ttov += $stat->getTov(); 
              		$tstl += $stat->getStl(); 
              		$tblk += $stat->getBlk(); 
              		$tpf += $stat->getPf(); 
              		$tpts += $stat->getPts();	
              ?>
             <tr class="<?php if($odd==1) { echo 'odd'; $odd=0; } else { echo 'even'; $odd=1; }?>">
                <td><?php echo $player->getNumber()?></td>
                <td><a href="<?php echo url_for('player/show?seasonId='.$seasonId.'&nick='.$player->getNick())?>"><?php echo $player->getFullName() ?></a></td>
                <td align="center"><?php echo $stat->getFgm().'-'. $stat->getFga()  ?></td>
                <td align="center"><?php echo $stat->getPt3m().'-'.$stat->getPt3a() ?></td>
                <td align="center"><?php echo $stat->getFtm().'-'.$stat->getFta() ?></td>
                <td align="center"><?php echo $stat->getOffreb() ?></td>
                <td align="center"><?php echo $stat->getReb() ?></td>
                <td align="center"><?php echo $stat->getAst() ?></td>
                <td align="center"><?php echo $stat->getTov() ?></td>
                <td align="center"><?php echo $stat->getStl() ?></td>
                <td align="center"><?php echo $stat->getBlk() ?></td>
                <td align="center"><?php echo $stat->getPf() ?></td>
                <td align="center"><?php echo $stat->getPts() ?></td>
              </tr>
            <?php endforeach; ?>
            
             <tr>
              	<td>
              		Totals 
              	</td>
              	<td>	 
              	</td>
              	<td align="center"><?php echo $tfgm.'-'.$tfga ?></td>
              	<td align="center"><?php echo $tpt3m.'-'.$tpt3a ?></td>
              	<td align="center"><?php echo $tftm.'-'.$tfta ?></td>
               	<td align="center"><?php echo $toff ?></td>
              	<td align="center"><?php echo $treb ?></td>
              	<td align="center"><?php echo $tast ?></td>
              	<td align="center"><?php echo $ttov ?></td>
              	<td align="center"><?php echo $tstl ?></td>
              	<td align="center"><?php echo $tblk ?></td>
              	<td align="center"><?php echo $tpf ?></td>
              	<td align="center"><?php echo $tpts ?></td>
            </tr>	
           </tbody>
         </table>
</div>
<div class="foot-footer"></div>
<div class="mod-content">
		<table cellspacing="1" cellpadding="3" class="tablehead">
			<tbody>
			<tr align="right" class="colhead">
				<td align="left">#</td>
				<td align="left">ТОГЛОГЧ</td>
				<td align="left">FGM-FGA</td>
				<td align="left">3PTA-3PTM</td>			
				<td align="left">FTM-FTA</td>				
				<td align="left">OFF</td>
				<td align="left">REB</td>
				<td align="left">AST</td>
				<td align="left">TOV</td>
				<td align="left">STL</td>
				<td align="left">BLK</td>
				<td align="left">PF</td>
				<td align="left">PTS</td>
            </tr>
       		<?php $odd=1;?>	
          	<?php $tfgm=0; $tfga=0; $tpt3m=0; $tpt3a=0; $tftm=0; $tfta=0; $toff=0; $treb=0; $tast=0; $ttov=0; $tstl=0; $tblk=0; $tpf=0; $tpts=0; ?>      
            <?php foreach ($players2 as $player): ?>
              <?php $playerId = $player->getId(); ?>
              <?php $stat = $stats[$playerId]; ?>
              <?php 
              		$tfgm += $stat->getFgm(); 
              		$tfga += $stat->getFga(); 
              		$tpt3m += $stat->getPt3m(); 
              		$tpt3a += $stat->getPt3a(); 
              		$tftm += $stat->getFtm(); 
              		$tfta += $stat->getFta(); 
              		$toff += $stat->getOffreb(); 
              		$treb += $stat->getReb(); 
              		$tast += $stat->getAst(); 
              		$ttov += $stat->getTov(); 
              		$tstl += $stat->getStl(); 
              		$tblk += $stat->getBlk(); 
              		$tpf += $stat->getPf(); 
              		$tpts += $stat->getPts();	
              ?>
             <tr class="<?php if($odd==1) { echo 'odd'; $odd=0; } else { echo 'even'; $odd=1; }?>">
                          <td><?php echo $player->getNumber()?></td>
                <td><a href="/player/show?nick=<?php echo $player->getNick()?>"><?php echo $player ?></a></td>
                <td align="center"><?php echo $stat->getFgm().'-'. $stat->getFga()  ?></td>
                <td align="center"><?php echo $stat->getPt3m().'-'.$stat->getPt3a() ?></td>
                <td align="center"><?php echo $stat->getFtm().'-'.$stat->getFta() ?></td>
                <td align="center"><?php echo $stat->getOffreb() ?></td>
                <td align="center"><?php echo $stat->getReb() ?></td>
                <td align="center"><?php echo $stat->getAst() ?></td>
                <td align="center"><?php echo $stat->getTov() ?></td>
                <td align="center"><?php echo $stat->getStl() ?></td>
                <td align="center"><?php echo $stat->getBlk() ?></td>
                <td align="center"><?php echo $stat->getPf() ?></td>
                <td align="center"><?php echo $stat->getPts() ?></td>
              </tr>
            <?php endforeach; ?>
            
             <tr>
              	<td>
              		Totals 
              	</td>
              	<td>	 
              	</td>
              	<td align="center"><?php echo $tfgm.'-'.$tfga ?></td>
              	<td align="center"><?php echo $tpt3m.'-'.$tpt3a ?></td>
              	<td align="center"><?php echo $tftm.'-'.$tfta ?></td>
               	<td align="center"><?php echo $toff ?></td>
              	<td align="center"><?php echo $treb ?></td>
              	<td align="center"><?php echo $tast ?></td>
              	<td align="center"><?php echo $ttov ?></td>
              	<td align="center"><?php echo $tstl ?></td>
              	<td align="center"><?php echo $tblk ?></td>
              	<td align="center"><?php echo $tpf ?></td>
              	<td align="center"><?php echo $tpts ?></td>
            </tr>	
           </tbody>
         </table>
</div>
<div class="foot-footer"></div>

<script type="text/javascript">

</script>
